import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;



import cn.yunhe.entity.LoginUser;

public class demo {
	Session session=null;
	@Before
	public void init() {
		Configuration cfg=new Configuration().configure();
		SessionFactory factory=cfg.buildSessionFactory();
		session=factory.openSession();
	}
	
	@Test
	public void name() {
//		Transaction tr=session.beginTransaction();
//		LoginUser loginUser=new LoginUser();
//		loginUser.setloginusername("admin");
//		loginUser.setloginuserpassword("admin");
//		session.save(loginUser);
//		System.out.println(loginUser.getloginusername());
//		tr.commit();
	}
	
	@After
	public void dest() {
		session.close();
	}
}
